<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"    
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        
        <title>Calendar</title>
        
    </h:head>
    <h:body>
        <h:form id="form">
            <p:growl id="msgs" showDetail="true"/>

            <p:dataTable id="eventDetail" var="e"
                         value="#{eventdata.eventList}">

                <f:facet name="header">  
                    Event List  
                </f:facet>

                <p:column  headerText="Name" style="width:200px;text-align:center">
                    <h:outputText value="#{e.eventname}"/>
                </p:column>
                
                <p:column headerText="City" style="width:100px;text-align:center">
                    <h:outputText value="#{e.city}"/>
                </p:column>

                <p:column headerText="Place" style="width:100px;text-align:center">
                    <h:outputText value="#{e.place}"/>
                </p:column>

                <p:column headerText="Date" style="width:100px;text-align:center">
                    <h:outputText value="#{e.eventdate}"/>
                </p:column>
                
                <p:column headerText="Start Time" style="width:30px;text-align:center">
                    <h:outputText value="#{e.timestart}"/>
                
                </p:column><p:column headerText="End Time" style="width:30px;text-align:center">
                    <h:outputText value="#{e.timefinish}"/>
                </p:column>

                <p:column headerText="Type" style="width:50px;text-align:center">
                    <h:outputText value="#{e.eventtype}"/>
                </p:column>

                <p:column headerText="Visibility" style="width:50px;text-align:center">
                    <h:outputText value="#{e.visibility}"/>
                </p:column>
                
                <p:column headerText="Weather" style="width:50px;text-align:center">
                    <h:outputText value="#{e.weather}"/>
                </p:column>

                <p:column headerText="Creator" style="width:200px;text-align:center">
                    <h:outputText value="#{e.creator}"/>
                </p:column>

                <p:column headerText="Edit" style="width:40px;text-align:center">
                    <h:link value="Edit" outcome="/user/event/editEvent">
                        <f:param name="id" value="#{e.id}" />
                        <f:param name="name" value="#{e.eventname}" />
                        <f:param name="city" value="#{e.city}" />
                        <f:param name="place" value="#{e.place}" />
                        <f:param name="date" value="#{e.eventdate}" />
                        <f:param name="type" value="#{e.eventtype}" />
                        <f:param name="visibility" value="#{e.visibility}" />
                        <f:param name="creator" value="#{e.creator}" />
                        <f:param name="weather" value="#{e.weather}" />
                        <f:param name="timestart" value="#{e.timestart}" />
                        <f:param name="timefinish" value="#{e.timefinish}" />
                    </h:link>
                </p:column>
                
                <p:column headerText="Delete" style="width:40px;text-align:center">
                    <p:commandButton icon="ui-icon-trash"
                                     action="#{deleteEventBean.DeleteEvent(e.id,
                                               e.eventname, e.place, e.eventdate,
                                               e.visibility, e.creator, 
                                               e.eventdate, e.city, e.weather)}"
                                     style="width:40px;height:30px"/>
                </p:column>

            </p:dataTable>
            
            <br/><center><p:commandButton value="Back to your Homepage" action="#{counter.count()}"
                                     style="width:200px;height:60px"/></center>
                                     
        </h:form>
    </h:body>
</html>
